
package com.platform.modules.sys.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import org.springframework.format.annotation.DateTimeFormat;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.platform.common.validator.group.AddGroup;
import com.platform.common.validator.group.UpdateGroup;

import lombok.Data;

/**
 * 组织机构实体 表名 sys_org
 *   
 * @author 肖亮
 * @date 2019-01-21 11:29:22
 */
@Data
@TableName("SYS_ORG")
@ApiModel(value="单位实体类",description="单位实体类")
public class SysOrgEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	public SysOrgEntity() {}
	public SysOrgEntity(String orgNo) {
		this.orgNo = orgNo;
	}

	@ApiModelProperty(value="机构编码（主键）",example="")
	@TableId
	private String orgNo;

	@ApiModelProperty(value="机构名称",example="")
	@NotBlank(message = "机构名称不能为空", groups = { AddGroup.class, UpdateGroup.class })
	private String orgName;

	@ApiModelProperty(value="上级机构编码",example="")
	@NotBlank(message = "上级机构不能为空", groups = { AddGroup.class, UpdateGroup.class })
	private String parentNo;
	
	@ApiModelProperty(value="机构级别",example="")
	@NotNull(message = "机构级别不能为空", groups = { AddGroup.class, UpdateGroup.class })
	private Integer orgLevel;

	@ApiModelProperty(value="机构类别（1.建设单位2.勘察单位3.设计单位4.审图办单位5.监管机构单位6.运维单位7.勘察设计 8.预拌混凝土单位）",example="")
	@NotNull(message = "机构类别不能为空", groups = { AddGroup.class, UpdateGroup.class })
	private String orgType;
	
	@ApiModelProperty(value="建设单位企业/个人（1企业2个人）",example="")
	private String orgPerson;
	
	@ApiModelProperty(value="状态 0：无效 1：有效",example="")
	private String status;
	
	@ApiModelProperty(value="排序",example="")
	private Integer sort;

	@ApiModelProperty(value="创建者ID",example="")
	private String createUserId;

	@ApiModelProperty(value="创建时间",example="")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date createTime;
	
	@ApiModelProperty(value="所在省份",example="")
	private String provinceNo;
	
	@ApiModelProperty(value="所在市",example="")
	private String cityNo;

	@ApiModelProperty(value="所在县",example="")
	private String countyNo;

	@ApiModelProperty(value="工商注册地址",example="")
	private String address;
	
	@ApiModelProperty(value="信用代码",example="")
	private String creditCode;

	@ApiModelProperty(value="工商登记类型",example="")
	private String ectType;

	@ApiModelProperty(value="工商登记类型",example="")
	private String ecoType;
	
	@ApiModelProperty(value="企业登记类型",example="")
	private String orgRegistType;

	@ApiModelProperty(value="法人代表",example="")
	private String comartiperson;
	
	@ApiModelProperty(value="法人手机号码",example="")
	private String comartiphone;
	
	@ApiModelProperty(value="法人身份证号",example="")
	private String comartiCertCode;
	
	@ApiModelProperty(value="企业联系人",example="")
	private String comconnperson;

	@ApiModelProperty(value="联系人电话",example="")
	private String comconnphone;

	@ApiModelProperty(value="基本户开户行",example="")
	private String basicAccountBank;

	@ApiModelProperty(value="企业联系电话",example="")
	private String orgLinkPhone;

	@ApiModelProperty(value="企业联系传真",example="")
	private String orgLinkFax;

	@ApiModelProperty(value="企业网址",example="")
	private String orgWebsite;

	@ApiModelProperty(value="企业联系邮箱",example="")
	private String orgLinkMailbox;

	@ApiModelProperty(value="基本户开户行账号",example="")
	private String basicAccountBankNo;

	@ApiModelProperty(value="最后年检日期",example="")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	private Date lastAnnualDate;

	@ApiModelProperty(value="工商注册日期",example="")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	private Date registerDate;

	@ApiModelProperty(value="营业执照登记机关",example="")
	private String licenseRegisterAuthor;

	@ApiModelProperty(value="注册资本金(人民币)",example="")
	private String registerCapital;

	@ApiModelProperty(value="企业经营地址",example="")
	private String businessAddress;
	
	@ApiModelProperty(value="企业营业期限",example="")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	private Date businessDate;
	
	@ApiModelProperty(value="经营地址邮编",example="")
	private String businessFax;

	@ApiModelProperty(value="经营范围",example="")
	private String businessScope;

	@ApiModelProperty(value="审查机构",example="")
	private String checkOrg;

	@ApiModelProperty(value="审查时间",example="")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	private Date checkTime;

	@ApiModelProperty(value="企业简介",example="")
	private String orgIntroduction;
	
	@ApiModelProperty(value="工商登记类型",example="")
	private String orgRegistryType;
	
	//////////////////////////////////////////////////////////非数据库字段
	
	@DateTimeFormat(pattern="yyyy-MM-dd")
	  @JsonFormat(
	          pattern = "yyyy-MM-dd",
	          timezone = "GMT+8"
	  )
	@ApiModelProperty(value="审核日期",example="")
	@TableField(exist = false)
	private Date auditTime;
	
	@ApiModelProperty(value="登录名",example="")
	@TableField(exist = false)
	private String userName;
	
	@ApiModelProperty(value="不通过原因",example="")
	@TableField(exist = false)
	private String auditTxt;
	
	@ApiModelProperty(value="审核单位名称",example="")
	@TableField(exist = false)
	private String auditOrgName;
	
	@ApiModelProperty(value="用户身份证号码",example="")
	@TableField(exist = false)
	private String userCard;
	
	@ApiModelProperty(value="机构类别（1.建设单位2.勘察单位3.设计单位4.审图办单位5.监管机构单位6.运维单位7.勘察设计）",example="")
	@TableField(exist = false)
	private String orgTypeName;

	@ApiModelProperty(value="状态 0：无效 1：有效",example="")
	@TableField(exist = false)
	private String statusName;

	@ApiModelProperty(value="上级机构名称",example="")
	@TableField(exist = false)
	private String parentName;

	@ApiModelProperty(value="企业账号Id",example="")
	@TableField(exist = false)
	private String userId;

	@ApiModelProperty(value="是否是更新",example="")
	@TableField(exist = false)
	private String ifUpdate;
	
	@ApiModelProperty(value="登录密码",example="")
	@TableField(exist = false)
	private String password;
	
	@ApiModelProperty(value="标记id(用于邮箱验证)",example="")
	@TableField(exist = false)
	private String signId;
	
	@ApiModelProperty(value="所在省名称",example="")
	@TableField(exist = false)
	private String provinceName;
	
	@ApiModelProperty(value="所在市名称",example="")
	@TableField(exist = false)
	private String cityName;
	
	@ApiModelProperty(value="所在镇名称",example="")
	@TableField(exist = false)
	private String countyName;
	
	@ApiModelProperty(value="企业账号联系方式",example="")
	@TableField(exist = false)
	private String contact;
	
	@ApiModelProperty(value="企业账号用户名信息",example="")
	@TableField(exist = false)
	private String realName;

	@ApiModelProperty(value="机构资质列表",example="")
	@TableField(exist = false)
	private List<SysOrgAptitudeEntity> orgAptitudeList;

	@ApiModelProperty(value="人员列表",example="")
	@TableField(exist = false)
	private List<SysUserEntity> userList;

	@ApiModelProperty(value="个人邮箱",example="")
	@TableField(exist = false)
	private String email;
	
	@ApiModelProperty(value="审查机构名称",example="")
	@TableField(exist = false)
	private String checkOrgName;
	

    @ApiModelProperty(value = "资质等级")
    private String zzdj;
    @ApiModelProperty(value = "资格证书名称")
    private String zgzsmc;
    @ApiModelProperty(value = "资格证书编号")
    private String zgzsbh;
	
	/**
	 * 增加equals判断
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		SysOrgEntity other = (SysOrgEntity) obj;
		if (orgNo == null) {
			if (other.orgNo != null)
				return false;
		} else if (!orgNo.equals(other.orgNo))
			return false;
		return true;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((orgNo == null) ? 0 : orgNo.hashCode());
		return result;
	}
	
}
